IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[csp_GetOriginatingSponsorNameInfoEd]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[csp_GetOriginatingSponsorNameInfoEd]
GO

--  csp_GetSponsorName 9363
CREATE PROCEDURE [dbo].[csp_GetOriginatingSponsorNameInfoEd]      
(      
	@sponsorId int   
)        
AS        
BEGIN    

    SELECT DISTINCT 
	 ASP.[Name] AS OriginatingSponsor 
     FROM      INSIGHT_RPT_DB.DBO.InfoEdProposal IEP 
	 JOIN INSIGHT_RPT_DB.dbo.AdmSponsor ASP 
			ON IEP.orig_spon = ASP.InfoEdSponCode
	where ASP.InfoEdSponCode  = @sponsorId


END

GO

